#pragma once
//============================================================================
// Copyright (C) 2003-2013 Brett R. Jones 
// All Rights Reserved
//
// You may redistribute and/or modify for non commercial and commercial uses 
// provided this copyright notice remains in place and is not modified
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================

#include "PktKeyReply.h"
#include <memory.h>
#include <stdio.h>

PktKeyReply::PktKeyReply()
{
    m_u16PktType = PKT_TYPE_KEY_REPLY;
    m_u16PktLen = sizeof( PktKeyReply );
    u16PktLibVersion = PKT_LIB_VERSION_BINARY;
    u16CapFlags = 0;
    u16OsType = 0;
    memset( as8Res, 0, sizeof( as8Res ) );
    u16OnlineCnt = 0;
    u32AppVersion = 0;
    as8AppVersion[ 0 ] = 0;
    atcUserList[ 0 ] = 0;
    u8LoginStatus = 0;
    as8LogonMsg[ 0 ] = 0;
    //vx_assert( 0 == (u16PktLen & 0x0f) );
}
void PktKeyReply::CalcPktLen( void )
{
    //calculate length of packet from length of file data
    m_u16PktLen = (unsigned short)ROUND_TO_16BYTE_BOUNDRY( sizeof( PktKeyReply ) - MAX_USER_LIST_LEN  + strlen( atcUserList )+1 );
}



